package com.shopoo.authorization.adapter.web;

import com.shopoo.api.IUserService;
import com.shopoo.dto.SingleResponse;
import com.shopoo.dto.clientobject.TokenCO;
import com.shopoo.dto.cqe.PasswordLoginCmd;
import jakarta.annotation.Resource;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @Author <a href="mailto:android_li@sina.cn">MaoYuan.Li</a>
 * @Date 2023/2/26 21:23
 */
@RestController
@RequestMapping("/user")
public class UserController {

	@Resource
	private IUserService iUserService;

	@PostMapping("/login")
	public SingleResponse<TokenCO> login(@Validated @RequestBody PasswordLoginCmd passwordLoginCmd) {
		return iUserService.login(passwordLoginCmd);
	}
}
